*------------------------------------------------------------------------------*
* Family history - Dinas, Fouka, Schläpfer - JoP
*------------------------------------------------------------------------------*

*------------------------------------------------------------------------------*
* Figure 3
*------------------------------------------------------------------------------*



*------------------------------------------------------------------------------*
* Greece
*------------------------------------------------------------------------------*

use greece, clear

gen above52=(age>=52)
replace above52=. if age==.
gen highschool=(edu>=4)
replace highschool=. if edu==.
gen ab1000=(income>=3)
replace ab1000=. if income==.
gen pension=(occupation==3 | occupation==4)
replace pension=. if occupation==.
gen public=(occupation==1)
replace public=. if occupation==.
gen employer=(occupation==5)
replace employer=. if occupation==.

gen fullsample=1
foreach x in asiaminor above52 highschool female ab1000 pension public employer nd syriza {
	gen t1_`x'=T*`x'
	replace fullsample=0 if `x'==.
}
local subgroups asiaminor above52 highschool female ab1000 pension public employer nd syriza 
local sample if fullsample==1
local controls i.age female i.nomos
estimates clear

reg pc_all_bst asiaminor T t1_asiaminor `controls' `sample', cl(municipality)
eststo mfull_a
reg pc_behst asiaminor T t1_asiaminor `controls' `sample', cl(municipality)
eststo mfull_b
reg pc_all_bst `subgroups' T t1_* `controls' `sample', cl(municipality)
eststo m0_a
reg pc_behst `subgroups' T t1_* `controls' `sample', cl(municipality)
eststo m0_b


coefplot (mfull_b, aseq("Asia Minor (sample)") keep(t1_asiaminor) mcolor(blue) ciopts(lcolor(blue blue)) label("Quasi-behavioral")) ///
(mfull_a, offset(-0.15) aseq("Asia Minor (sample)") keep(t1_asiaminor) mcolor(red) ciopts(lcolor(red red)) label("Attitudes")) ///
(m0_b, aseq("Asia Minor") keep(t1_asiaminor) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, offset(-0.15) aseq("Asia Minor") keep(t1_asiaminor) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Age: Above median") mcolor(blue) keep(t1_above52) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Age: Above median") offset(-0.15)  mcolor(red) keep(t1_above52) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Completed high school") keep(t1_highschool) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Completed high school") offset(-0.15)  keep(t1_highschool) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Female") keep(t1_female) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Female") offset(-0.15)  keep(t1_female) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Income: Above median") keep(t1_ab1000) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Income: Above median") offset(-0.15)  keep(t1_ab1000) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Retired") keep(t1_pension) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Retired") offset(-0.15)  keep(t1_pension) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Public sector") mcolor(blue) keep(t1_public) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Public sector") offset(-0.15)  keep(t1_public) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Employer") mcolor(blue) keep(t1_employer) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Employer") offset(-0.15)  keep(t1_employer) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Voted ND") mcolor(blue) keep(t1_nd) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Voted ND") offset(-0.15)  keep(t1_nd) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m0_b, aseq("Voted Syriza") mcolor(blue) keep(t1_syriza) ciopts(lcolor(blue blue)) nokey) ///
(m0_a, aseq("Voted Syriza") offset(-0.15)  keep(t1_syriza) mcolor(red) ciopts(lcolor(red red)) nokey), ci(95 90) xline(0, lcolor(gs10)) ///
ysca(titlegap(2)) msize(small) ///
xtitle("Differential treatment effect", size(small)) ytitle("", size(small)) ///
xlabel(, nogrid labsize(small)) ylabel(, nogrid labsize(small)) xsca(titlegap(2)) yline(1.5, lcolor(black) lpattern(dash)) ///
grid(none) swapnames legend(size(small) cols(1) width(28)) title("Greece", size(small))

graph save Greece.gph, replace

*------------------------------------------------------------------------------*
* Germany
*------------------------------------------------------------------------------*

use germany, clear

gen fullsample=1
foreach x in ageabovemed highschool income_ok female centerleft centerright {
	gen t1_`x'=t1*`x'
	replace fullsample=0 if `x'==.
}
local subgroups female ageabovemed highschool income_ok centerleft centerright  
local controls i.state
estimates clear

reg pc_att expellee t1 inter_exp_t1 `controls' if fullsample==1, cl(GKZ)
eststo m_full_a
reg donate_st expellee t1 inter_exp_t1  `controls' if fullsample==1, cl(GKZ)
eststo m_full_b

reg pc_att expellee t1 inter_exp_t1 `subgroups' t1_* `controls', cl(GKZ)
eststo m_exp_a
reg donate_st expellee t1 inter_exp_t1  `subgroups' t1_* `controls', cl(GKZ)
eststo m_exp_b


coefplot (m_full_b, aseq("Expellee (sample)") keep(inter_exp_t1) mcolor(blue) ciopts(lcolor(blue blue)) label("Donation")) ///
(m_full_a, offset(-0.15) aseq("Expellee (sample)") keep(inter_exp_t1) mcolor(red) ciopts(lcolor(red red)) label("Attitudes")) ///
(m_exp_b, aseq("Expellee") keep(inter_exp_t1) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, offset(-0.15) aseq("Expellee") keep(inter_exp_t1) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m_exp_b, aseq("Female") mcolor(blue) keep(t1_female) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, aseq("Female") offset(-0.15)  mcolor(red) keep(t1_female) ciopts(lcolor(red red)) nokey) ///
(m_exp_b, aseq("Age: Above median") keep(t1_ageabovemed) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, aseq("Age: Above median") offset(-0.15)  keep(t1_ageabovemed) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m_exp_b, aseq("Completed high school") keep(t1_highschool) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, aseq("Completed high school") offset(-0.15)  keep(t1_highschool) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m_exp_b, aseq("Lives comfortably") keep(t1_income_ok) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, aseq("Lives comfortably") offset(-0.15)  keep(t1_income_ok) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m_exp_b, aseq("Center left") keep(t1_centerleft) mcolor(blue) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, aseq("Center left") offset(-0.15)  keep(t1_centerleft) mcolor(red) ciopts(lcolor(red red)) nokey) ///
(m_exp_b, aseq("Center right") mcolor(blue) keep(t1_centerright) ciopts(lcolor(blue blue)) nokey) ///
(m_exp_a, aseq("Center right") offset(-0.15)  keep(t1_centerright) mcolor(red) ciopts(lcolor(red red)) nokey), ci(95 90) xline(0, lcolor(gs10)) ///
ysca(titlegap(2)) msize(small) ///
xtitle("Differential treatment effect", size(small)) ytitle("", size(small)) ///
xlabel(, nogrid labsize(small)) ylabel(, nogrid labsize(small)) xsca(titlegap(2)) yline(1.5, lcolor(black) lpattern(dash)) ///
grid(none) swapnames legend(size(small) cols(1)) title("Germany", size(small))

graph save Germany.gph, replace

*------------------------------------------------------------------------------*
* Combine
*------------------------------------------------------------------------------*


graph combine Greece.gph Germany.gph, xcommon iscale(1)

